//
//  ViewController.m
//  20-JSONHomeWork
//
//  Created by 鹏飞罗 on 16/8/10.
//  Copyright © 2016年 罗鹏飞. All rights reserved.
//

#import "ViewController.h"
#import "FindCar.h"
#import "Result.h"
@interface ViewController ()
@property (nonatomic, strong) FindCar *findCar;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    [self handleData];
}
- (void)handleData {
    NSString *carPath = [[NSBundle mainBundle] pathForResource:@"AllCar" ofType:@"json"];
    NSData *carData = [NSData dataWithContentsOfFile:carPath];
    NSError *error = nil;
    NSDictionary *findCarDic = [NSJSONSerialization JSONObjectWithData:carData options:NSJSONReadingMutableContainers error:&error];
    self.findCar = [FindCar modelWithDic:findCarDic];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
